load("@rules_cc//cc:defs.bzl", "cc_test")

_TESTS = {
    # Fails to build because of non const lvalue "test__helper": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp "test_array": [],
    "test_binary": [],
    "test_bitset": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp "test_boost_array": [],
    # Fails to build because of static assertion failure "test_check": [],
    # Fails "test_class_info_load": [],
    "test_class_info_save": [],
    "test_codecvt_null": [],
    "test_complex": [],
    # Fails to build because of static assetion failure "test_const_load_fail1_nvp": [],
    # Fails to build because of static assetion failure "test_const_load_fail1": [],
    # Fails to build because of static assetion failure "test_const_load_fail2_nvp": [],
    # Fails to build because of static assetion failure "test_const_load_fail2": [],
    # Fails to build because of static assetion failure "test_const_load_fail3_nvp": [],
    # Fails to build because of static assetion failure "test_const_load_fail3": [],
    # Fails to build because of unit_test_main being undefined "test_const_pass": [],
    # Fails to build because of unit_test_main being undefined "test_const_save_warn1_nvp": [],
    # Fails to build because of unit_test_main being undefined "test_const_save_warn1": [],
    # Fails to build because of unit_test_main being undefined "test_const_save_warn2_nvp": [],
    # Fails to build because of unit_test_main being undefined "test_const_save_warn2": [],
    # Fails to build because of unit_test_main being undefined "test_const_save_warn3_nvp": [],
    # Fails to build because of unit_test_main being undefined "test_const_save_warn3": [],
    # Fails to build because of unit_test_main being undefined "test_const_save_warn4_nvp": [],
    # Fails to build because of unit_test_main being undefined "test_const_save_warn4": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_contained_class": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_cyclic_ptrs": [],
    "test_delete_pointer": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_deque": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_derived_class_ptr": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_derived_class": [],
    "test_derived": [],
    "test_diamond_complex": [],
    "test_diamond": [],
    # Fails to build because of non const lvalue "test_dll_exported": [],
    # Fails to link because of undefined symbols to binary iarchive "test_dll_plugin": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_dll_simple": [],
    # Fails to build because it calls a protected constructor "test_enable_shared_from_this": [],
    # Fails to build because of non const lvalue "test_exported": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_forward_list_ptrs": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_forward_list": [],
    "test_helper_support": [],
    "test_inclusion": [],
    "test_inclusion2": [],
    # Fails to build because of unit_test_main being undefined "test_interators": [],
    "test_interrupts": [],
    "test_iterators_base64": [],
    "test_iterators": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_list_ptrs": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_list": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_map_boost_unordered": [],
    # Fails to build because there is no boost hash map defined "test_map_hashed": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_map_unordered": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_map": [],
    "test_mi": [],
    "test_mult_archive_types": [],
    # Fails to link because there are undefined symbols for f() and g() "test_multi_shared_lib": [],
    "test_multiple_inheritance": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_multiple_ptrs": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_native_array": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_new_operator": [],
    # Fails to build because of non const lvalue "test_no_rtti": [],
    "test_non_default_ctor": [],
    "test_non_default_ctor2": [],
    "test_non_intrusive": [],
    # Fails to build because of static assertion failure "test_not_serializable": [],
    "test_null_ptr": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_nvp": [],
    "test_object": [],
    "test_optional": [],
    # Fails to build because of non const lvalue "test_p_helper": [],
    # Fails to build because it cannot find headers in @boost.compatibility "test_pimpl": [],
    # Fails to build because of unit_test_main being undefined and to A.hpp and A.ipp "test_polymorphic_A": [],
    # Fails to build because of non const lvalue "test_polymorphic": [],
    # Fails to build because of non const lvalue "test_polymorphic2": [],
    # Fails to build because of unit_test_main being undefined "test_polymorphic2imp": [],
    "test_primitive": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_priority_queue": [],
    "test_private_base": [],
    "test_private_base2": [],
    "test_private_ctor": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_queue": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_recursion": [],
    "test_registered": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_reset_object_address": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_set_boost_unordered": [],
    # Fails to build because there is no boost hash map defined "test_set_hashed": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_set_unordered": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_set": [],
    "test_shared_ptr_132": [],
    "test_shared_ptr_multi_base": [],
    "test_shared_ptr": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_simple_class_ptr": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_simple_class": [],
    "test_singleton_inherited": [],
    "test_singleton_plain": [],
    "test_singleton": [],
    # Fails to build because slist doesnt exist "test_slist_ptrs": [],
    # Fails to build because slist doesnt exist "test_slist": [],
    "test_smart_cast": [],
    "test_split": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_stack": [],
    "test_static_warning": [],
    "test_strong_typedef": [],
    "test_tracking": [],
    # Fails to build because of static assertion failure "test_traits_fail": [],
    "test_traits_pass": [],
    "test_unique_ptr": [],
    "test_unregistered": [],
    "test_valarray": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_variant": [],
    # Fails to link because of undefined symbols to A.hpp and A.ipp and B.hpp and B.ipp "test_vector": [],
    "test_void_cast": [],
    "test_z": [],
}

[cc_test(
    name = test,
    srcs = ["{}.cpp".format(test)] + glob(["*.hpp"]) + glob(["*.ipp"]),
    defines = select({
        "@platforms//os:windows": ["WIN32_LEAN_AND_MEAN=1"],
        "@platforms//os:macos": [],
        "//conditions:default": [],
    }),
    linkstatic = True,
    deps = [
        "@boost.compatibility",
        "@boost.filesystem",
        "@boost.math",
        "@boost.serialization",
        "@boost.test",
        "@boost.test//:unit_test_main",
    ] + _TESTS[test],
) for test in _TESTS]
